home *** CD-ROM | disk | FTP | other *** search
- (******************************************************************************)
- (* PROGRAM DRVDEMO *)
- (* *)
- (* Version 4.00 *)
- (* *)
- (* Copyright (C) 1991, 1992 by FeerKnott Computing *)
- (* *)
- (* 3922 Englewood Drive *)
- (* Champaign, IL 61821 *)
- (* *)
- (* (217) 355-8145 (voice) *)
- (* (217) 355-9661 (modem) *)
- (* CIS [71160,1045] *)
- (* *)
- (* ALL RIGHTS RESERVED *)
- (******************************************************************************)
-
- (******************************************************************************)
- (* Written by: Charles B. Little, Ph.D. *)
- (* Version: 4.00 *)
- (* Revision Date: 29 November 1992 *)
- (* Purpose: To demonstrate the use of unit DRIVExx - ver 4.00 - to *)
- (* obtain important information about disk drives. *)
- (******************************************************************************)
-
- {$S-,R-}
-
- PROGRAM DRVDEMO;
-
- USES DOS, CRT, DRIVExx;
-
- {$I drvdemo.inc}
-
- var index : char;
- X : longint;
- DP : fakeDPB;
- G : word;
-
- BEGIN
- clrscr;
- if DriveError <> 0 then
- begin
- ShowDriveError;
- clrscr;
- end;
-
- Openingscreen;
-
- for index := 'A' to chr($60) do { $5B thru $60 are for Novell drives }
- begin
- positioncursor;
- if DrivExists(index) then
- begin
- writeln;writeln(index,':');
- write('BIOS #',ShowBIOSDriveNum(index),', ');
- if DriveisNormal(index) then
- begin
- write('normal:');
- if DriveisRemovable(index) then
- begin
- write(' removable');
- case RemovableDrivetype(index) of
- $FF : write(', Drivetype error $FF');
- 1 : write(', 5.25" DD');
- 2 : write(', 5.25" HD');
- 3 : write(', 3.5" DD');
- 4 : write(', 3.5" HD');
- 5 : write(', 3.5" QD');
- 6 : write(', Tape');
- 7 : write(', Bernoulli');
- 8 : write(', CDROM');
- else write(', type = ?');
- end; {case}
- if ChangeLineSupported(index) then
- if DiskWasChanged(index) then write(', changed')
- else write(', not changed');
- end
- else
- begin
- if DriveisHard(index) then write(' hard');
- if DriveisRAMDisk(index) then write(' RAMDisk');
- if DriveisOtherfixed(index) then write(' unknown fixed');
- end;
- X := DiskSyze(index);
- {can't use LONGINT variables as selectors in case statements, so we
- must handle DiskSyze in a less than elegant way}
- if (X = -1) then write(', size = error')
- else
- if (X = 0) then write(', size = ?')
- else
- write(', size = ',X);
- if (DriveMappedTo(index) <> index) then
- write(', attached to ',DriveMappedTo(index),':');
-
- end {driveisnormal}
- else
- begin
- write('abnormal:');
- if DriveisPhantom(index) then
- write(' phantom, mapped to ',DriveMappedTo(index),':');
- if DriveisAliased(index) then
- begin
- if DRDOS then write(' aliased')
- { DRDOS reports SUBST when *either* ASSIGN or SUBST is used. Since
- we cannot verify that NETWORK and IFS will be reported correctly
- under DRDOS, we recommend that the generic "aliased" be used to
- classify ALL of these situations below when running under that OS }
- else
- begin
- if DriveisJoined(index) then write(' joined');
- if DriveisSubsted(index) then write(' substituted');
- if DriveisAssigned(index) then
- write(' assigned to ',DriveMappedTo(index),':');
- end;
- end;
- if DriveisNetwork(index) then write(' network');
- if DriveisIFS(index) then write(' IFS');
- end; {driveisabnormal}
-
- {the following apply to all drives, normal or abnormal}
- writeln;
- if DriveisNONDOS(index) then writeln('Drive is NON-DOS (not IBM block format)');
- if (NetWareLoaded and DriveIsNetwork(index)) then
- writeln('Drive flag = ',GetNetwareDriveType(index))
- else
- writeln('Logged Directory is ',CurrentDir(index));
- writeln('Physical type code = ',physicaltype(index));
- end; {if drivexists}
- end; {for index := 'A' to ''' do}
-
-
- writeln;writeln;
- write('Enter a drive letter to demonstrate function GETDPB ');
- index := readkey;
- if (not drivexists(index)) and (not driveisnormal(index)) then halt;
- clrscr;
-
- G := GETDPB(index,DP,false);
- if (G = 0) then {FALSE means don't hit the disk}
- begin
- writeln;
- writeln('Drive ',upcase(index),': DPB data in memory');
- showdpbdata(DP);
- end
- else
- begin
- writeln;
- writeln('Drive ',upcase(index),': access failed or drive invalid. Error ',hi(G),':',lo(G));
- halt;
- end;
-
-
- write('Press ENTER to get *NEW* DPB data');
- readln;clrscr;
-
- G := GETDPB(index,DP,true);
- if (G = 0) then {TRUE means hit the disk}
- begin
- writeln;
- writeln('Drive ',upcase(index),': DPB data from direct disk access');
- showdpbdata(DP);
- end
- else
- begin
- writeln;
- writeln('Drive ',upcase(index),': access failed or drive invalid. Error ',hi(G),':',lo(G));
- halt;
- end;
- END.